<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<title>nih: nih::cuda::LBVH_builder&lt; Integer &gt; Struct Template Reference</title>

<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript">
  $(document).ready(initResizable);
</script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/search.js"></script>
<script type="text/javascript">
  $(document).ready(function() { searchBox.OnSelectItem(0); });
</script>

</head>
<body>
<div id="top"><!-- do not remove this div! -->


<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  
  
  <td style="padding-left: 0.5em;">
   <div id="projectname">nih
   &#160;<span id="projectnumber">0.5</span>
   </div>
   
  </td>
  
  
  
 </tr>
 </tbody>
</table>
</div>

<!-- Generated by Doxygen 1.7.5.1 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Main&#160;Page</span></a></li>
      <li><a href="modules.html"><span>Modules</span></a></li>
      <li class="current"><a href="annotated.html"><span>Classes</span></a></li>
      <li><a href="files.html"><span>Files</span></a></li>
      <li>
        <div id="MSearchBox" class="MSearchBoxInactive">
        <span class="left">
          <img id="MSearchSelect" src="search/mag_sel.png"
               onmouseover="return searchBox.OnSearchSelectShow()"
               onmouseout="return searchBox.OnSearchSelectHide()"
               alt=""/>
          <input type="text" id="MSearchField" value="Search" accesskey="S"
               onfocus="searchBox.OnSearchFieldFocus(true)" 
               onblur="searchBox.OnSearchFieldFocus(false)" 
               onkeyup="searchBox.OnSearchFieldChange(event)"/>
          </span><span class="right">
            <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
          </span>
        </div>
      </li>
    </ul>
  </div>
  <div id="navrow2" class="tabs2">
    <ul class="tablist">
      <li><a href="annotated.html"><span>Class&#160;List</span></a></li>
      <li><a href="classes.html"><span>Class&#160;Index</span></a></li>
      <li><a href="hierarchy.html"><span>Class&#160;Hierarchy</span></a></li>
      <li><a href="functions.html"><span>Class&#160;Members</span></a></li>
    </ul>
  </div>
</div>
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
  initNavTree('structnih_1_1cuda_1_1_l_b_v_h__builder.html','');
</script>
<div id="doc-content">
<div class="header">
  <div class="summary">
<a href="#pub-methods">Public Member Functions</a> &#124;
<a href="#pub-attribs">Public Attributes</a>  </div>
  <div class="headertitle">
<div class="title">nih::cuda::LBVH_builder&lt; Integer &gt; Struct Template Reference<div class="ingroups"><a class="el" href="group__bvh.html">Bounding Volume Hierarchies</a></div></div>  </div>
</div>
<div class="contents">
<!-- doxytag: class="nih::cuda::LBVH_builder" -->
<p><code>#include &lt;<a class="el" href="lbvh__builder_8h_source.html">lbvh_builder.h</a>&gt;</code></p>

<p><a href="structnih_1_1cuda_1_1_l_b_v_h__builder-members.html">List of all members.</a></p>
<table class="memberdecls">
<tr><td colspan="2"><h2><a name="pub-methods"></a>
Public Member Functions</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structnih_1_1cuda_1_1_l_b_v_h__builder.html#a741aaa3327c755146ab412eb87431c0e">LBVH_builder</a> (thrust::device_vector&lt; <a class="el" href="structnih_1_1_bvh__node.html">Bvh_node</a> &gt; &amp;nodes, thrust::device_vector&lt; uint2 &gt; &amp;leaves, thrust::device_vector&lt; uint32 &gt; &amp;index)</td></tr>
<tr><td class="memTemplParams" colspan="2">template&lt;typename Iterator &gt; </td></tr>
<tr><td class="memTemplItemLeft" align="right" valign="top">void&#160;</td><td class="memTemplItemRight" valign="bottom"><a class="el" href="structnih_1_1cuda_1_1_l_b_v_h__builder.html#abb1ce022488c550e59cc87cd3d7ff2db">build</a> (const <a class="el" href="structnih_1_1_bbox.html">Bbox3f</a> bbox, const Iterator points_begin, const Iterator points_end, const uint32 max_leaf_size)</td></tr>
<tr><td colspan="2"><h2><a name="pub-attribs"></a>
Public Attributes</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a0b8eb3c5e55eb1c1b41745eebb6d5fe8"></a><!-- doxytag: member="nih::cuda::LBVH_builder::m_nodes" ref="a0b8eb3c5e55eb1c1b41745eebb6d5fe8" args="" -->
thrust::device_vector&lt; <a class="el" href="structnih_1_1_bvh__node.html">Bvh_node</a> &gt; *&#160;</td><td class="memItemRight" valign="bottom"><b>m_nodes</b></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a6c9e55bc74cd538a570545b6e3d844d1"></a><!-- doxytag: member="nih::cuda::LBVH_builder::m_leaves" ref="a6c9e55bc74cd538a570545b6e3d844d1" args="" -->
thrust::device_vector&lt; uint2 &gt; *&#160;</td><td class="memItemRight" valign="bottom"><b>m_leaves</b></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="adffd2893f591cbfdf739f4fed2286114"></a><!-- doxytag: member="nih::cuda::LBVH_builder::m_index" ref="adffd2893f591cbfdf739f4fed2286114" args="" -->
thrust::device_vector&lt; uint32 &gt; *&#160;</td><td class="memItemRight" valign="bottom"><b>m_index</b></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a376c30ff9138469f55d9430a16515688"></a><!-- doxytag: member="nih::cuda::LBVH_builder::m_codes" ref="a376c30ff9138469f55d9430a16515688" args="" -->
thrust::device_vector&lt; Integer &gt;&#160;</td><td class="memItemRight" valign="bottom"><b>m_codes</b></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a352b7b543cdf20e82f8eb7b54cfd8eff"></a><!-- doxytag: member="nih::cuda::LBVH_builder::m_levels" ref="a352b7b543cdf20e82f8eb7b54cfd8eff" args="[64]" -->
uint32&#160;</td><td class="memItemRight" valign="bottom"><b>m_levels</b> [64]</td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="afa6951af58c2fad682f53a49a532ebed"></a><!-- doxytag: member="nih::cuda::LBVH_builder::m_bbox" ref="afa6951af58c2fad682f53a49a532ebed" args="" -->
<a class="el" href="structnih_1_1_bbox.html">Bbox3f</a>&#160;</td><td class="memItemRight" valign="bottom"><b>m_bbox</b></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a3c66a96b0e21e87163c1eaf05ae6d141"></a><!-- doxytag: member="nih::cuda::LBVH_builder::m_node_count" ref="a3c66a96b0e21e87163c1eaf05ae6d141" args="" -->
uint32&#160;</td><td class="memItemRight" valign="bottom"><b>m_node_count</b></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="aeb2d4f7c26131c35dc2027af6c77c7f3"></a><!-- doxytag: member="nih::cuda::LBVH_builder::m_leaf_count" ref="aeb2d4f7c26131c35dc2027af6c77c7f3" args="" -->
uint32&#160;</td><td class="memItemRight" valign="bottom"><b>m_leaf_count</b></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="aa81c7e2cd1d6736939028e783d126281"></a><!-- doxytag: member="nih::cuda::LBVH_builder::m_kd_context" ref="aa81c7e2cd1d6736939028e783d126281" args="" -->
<a class="el" href="structnih_1_1cuda_1_1_bintree__gen__context.html">cuda::Bintree_gen_context</a>&#160;</td><td class="memItemRight" valign="bottom"><b>m_kd_context</b></td></tr>
</table>
<hr/><a name="details" id="details"></a><h2>Detailed Description</h2>
<div class="textblock"><h3>template&lt;typename Integer&gt;<br/>
struct nih::cuda::LBVH_builder&lt; Integer &gt;</h3>

<p>GPU-based Linar BVH builder</p>
<p>This class provides the context to generate LBVHs on the GPU starting from a set of unordered points. The output is a set of nodes with the corresponding leaves and a set of primitive indices into the input set of points. The output leaves will specify contiguous ranges into this index.</p>
<dl><dt><b>Template Parameters:</b></dt><dd>
  <table class="">
    <tr><td class="paramname">Integer</td><td>an integer type that determines the number of bits used to compute the points' Morton codes. Accepted values are uint32 and uint64.</td></tr>
  </table>
  </dd>
</dl>
<p>The following code snippet shows how to use this builder:</p>
<div class="fragment"><pre class="fragment"><span class="preprocessor"> #include &lt;<a class="code" href="lbvh__builder_8h.html" title="Interface for a CUDA-based LBVH builder.">nih/bvh/cuda/lbvh_builder.h</a>&gt;</span>

 thrust::device_vector&lt;Vector3f&gt; points;
 ... <span class="comment">// code to fill the input vector of points</span>

 thrust::device_vector&lt;Bvh_node&gt; bvh_nodes;
 thrust::device_vector&lt;uint2&gt;    bvh_leaves;
 thrust::device_vector&lt;uint32&gt;   bvh_index;

 <a class="code" href="structnih_1_1cuda_1_1_l_b_v_h__builder.html">nih::cuda::LBVH_builder&lt;uint64&gt;</a> builder( bvh_nodes, bvh_leaves, bvh_index );
 builder.build(
     Bbox3f( Vector3f(0.0f), Vector3f(1.0f) ),   <span class="comment">// suppose all bboxes are in [0,1]^3</span>
     points.begin(),                             <span class="comment">// begin iterator</span>
     points.end(),                               <span class="comment">// end iterator</span>
     4 );                                        <span class="comment">// target 4 objects per leaf</span>
</pre></div> </div><hr/><h2>Constructor &amp; Destructor Documentation</h2>
<a class="anchor" id="a741aaa3327c755146ab412eb87431c0e"></a><!-- doxytag: member="nih::cuda::LBVH_builder::LBVH_builder" ref="a741aaa3327c755146ab412eb87431c0e" args="(thrust::device_vector&lt; Bvh_node &gt; &amp;nodes, thrust::device_vector&lt; uint2 &gt; &amp;leaves, thrust::device_vector&lt; uint32 &gt; &amp;index)" -->
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename Integer&gt; </div>
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="structnih_1_1cuda_1_1_l_b_v_h__builder.html">nih::cuda::LBVH_builder</a>&lt; Integer &gt;::<a class="el" href="structnih_1_1cuda_1_1_l_b_v_h__builder.html">LBVH_builder</a> </td>
          <td>(</td>
          <td class="paramtype">thrust::device_vector&lt; <a class="el" href="structnih_1_1_bvh__node.html">Bvh_node</a> &gt; &amp;&#160;</td>
          <td class="paramname"><em>nodes</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">thrust::device_vector&lt; uint2 &gt; &amp;&#160;</td>
          <td class="paramname"><em>leaves</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">thrust::device_vector&lt; uint32 &gt; &amp;&#160;</td>
          <td class="paramname"><em>index</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td><code> [inline]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>constructor</p>
<dl><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramname">nodes</td><td>output nodes array </td></tr>
    <tr><td class="paramname">leaves</td><td>output leaf array </td></tr>
    <tr><td class="paramname">index</td><td>output index array </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<hr/><h2>Member Function Documentation</h2>
<a class="anchor" id="abb1ce022488c550e59cc87cd3d7ff2db"></a><!-- doxytag: member="nih::cuda::LBVH_builder::build" ref="abb1ce022488c550e59cc87cd3d7ff2db" args="(const Bbox3f bbox, const Iterator points_begin, const Iterator points_end, const uint32 max_leaf_size)" -->
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename Integer &gt; </div>
<div class="memtemplate">
template&lt;typename Iterator &gt; </div>
      <table class="memname">
        <tr>
          <td class="memname">void <a class="el" href="structnih_1_1cuda_1_1_l_b_v_h__builder.html">nih::cuda::LBVH_builder</a>&lt; Integer &gt;::build </td>
          <td>(</td>
          <td class="paramtype">const <a class="el" href="structnih_1_1_bbox.html">Bbox3f</a>&#160;</td>
          <td class="paramname"><em>bbox</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const Iterator&#160;</td>
          <td class="paramname"><em>points_begin</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const Iterator&#160;</td>
          <td class="paramname"><em>points_end</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const uint32&#160;</td>
          <td class="paramname"><em>max_leaf_size</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>build a bvh given a set of points that will be reordered in-place</p>
<dl><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramname">bbox</td><td>global bbox </td></tr>
    <tr><td class="paramname">points_begin</td><td>beginning of the point sequence to sort </td></tr>
    <tr><td class="paramname">points_end</td><td>end of the point sequence to sort </td></tr>
    <tr><td class="paramname">max_leaf_size</td><td>maximum leaf size </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<hr/>The documentation for this struct was generated from the following files:<ul>
<li>bvh/cuda/<a class="el" href="lbvh__builder_8h_source.html">lbvh_builder.h</a></li>
<li>bvh/cuda/<a class="el" href="lbvh__builder__inline_8h_source.html">lbvh_builder_inline.h</a></li>
</ul>
</div>
</div>
  <div id="nav-path" class="navpath">
    <ul>
      <li class="navelem"><b>nih</b>      </li>
      <li class="navelem"><b>cuda</b>      </li>
      <li class="navelem"><a class="el" href="structnih_1_1cuda_1_1_l_b_v_h__builder.html">LBVH_builder</a>      </li>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
<a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(0)"><span class="SelectionMark">&#160;</span>All</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark">&#160;</span>Classes</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark">&#160;</span>Files</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(3)"><span class="SelectionMark">&#160;</span>Functions</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(4)"><span class="SelectionMark">&#160;</span>Variables</a></div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>


    <li class="footer">Generated on Thu Dec 15 2011 11:56:22 for nih by
    <a href="http://www.doxygen.org/index.html">
    <img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.7.5.1 </li>
   </ul>
 </div>


</body>
</html>
